<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>javascript基本语法</title>
    <script>
        alert("你大爷的！！");
    </script>
</head>
<body>
<h3 style="text-align: center">打印倒三角形排列的小太阳</h3>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td style="text-align: center">
            <script>
                var sun = "\u263c";//小太阳的Unicode码
                var num = prompt("请输入需要打印出多少行小太阳：", "10");
                for (var r = num; r > 0; r--) {
                    for (var c = 0; c < r; c++) {
                        document.write("&nbsp;&nbsp;" + sun + "&nbsp;&nbsp;")
                    }
                    document.write("<br/>");
                }
            </script>
        </td>
    </tr>
</table>
<h1>JavaScript操作HTML 元素</h1>
<p id="pid">这是原始的段落内容！！</p>
<script>
    document.getElementById("pid").innerHTML = "通过 id 获取HTML元素！";
</script>
</body>
</html>